<!DOCTYPE html>
<html>
<head>
  {include file="common/meta" /}
  {include file="common/link" /}
<style>
body { background-color: #fff!important; }
</style>
</head>
<body class="body-1">
<div id="container">
  <div class="custom-search" >
    <form action="" method="POST">
      <input type="search" class="custom-search-input keywords " placeholder="搜索客户" name="keywords" value="{$keywords}" />
      <button type="submit" class="custom-search-button">搜索</button>
    </form>
  </div>
  <!--购物车为空-->

  <!--购物车为空-->
    <div>
    <div id="footer" class="footer mui-bar-tab cart-btn-box centerflex line-top">
      <a href="javascript:history.go(-1);">上一步</a> <span class="del-car" style="display: none;">删除</span>
      <label>
<!--        <input type="checkbox" value="1" class="checkall">全选-->
      </label>
      <div class="total-price box-flex-1">
<!--        <p>共<em class="selectedNum">0</em>件商品</p>-->
<!--        <p class="total">合计：<span class="allprice">0.00</span>元</p>-->
      </div>
      <a class="next_step">下一步</a> <span class="del-car" style="display: none;">删除</span>
    </div>


    <div class="mui-content">
      <div class="home-link-box bgcolor-white clearfix">
        <a href="javascript:void(0)" class="fl">
          <i class="iconfont icon-shop"></i>
        </a>
        <div class="car-edit fr">
<!--          <span ><a href="/web/customer/add">新增</a></span>-->
          <span class="addcustomer">新增</span>
        </div>
      </div>
      <div id="car-list" class="car-list">
        <ul class="showcart">
            <!--  -->
          {volist name="list" id="vo"}
              <div class="weui-cell weui-cell_swiped">
                <div class="weui-cell__bd" style="transform: translate3d(0px, 0px, 0px);">
                  <li class="display-box-middle weui-cell">

                    <div class="weui-cells weui-cells_checkbox" >
                      <label class="weui-cell weui-check__label" for="s11">
                        <div class="weui-cell__hd">
                          <input type="radio" class="weui-check" name="checkbox1" id="s11" value="{$vo.id}">
                          <i class="weui-icon-checked"></i>
                        </div>
                      </label>
                    </div>
                    <div class="car-list-txt box-flex-1  " style="width: 70%;overflow: hidden">
                      <a href="###" class="link">
                        <div class="weui-cells__title">{$vo.company}</div>
                        <p class="d-specs">负责人: {$vo.nickname}</p>
                        <p><span class="line-top">电&nbsp;&nbsp;&nbsp;&nbsp;话:{$vo.mobile} </span></p>
                        <p><span class="line-top" >地&nbsp;&nbsp;&nbsp;&nbsp;址:{$vo.address} </span></p>
                      </a>
                    </div>
                  </li>
                </div>
                <div class="weui-cell__ft">
                  <a class="weui-swiped-btn weui-btn_primary edit-swipeout" href="javascript:" style="display: flex;align-items: center;justify-content: center;" data-id="{$vo.id}"> 编辑</a>
                </div>
              </div>
          {/volist}
        </ul>
      </div>
    </div>
  </div>
    <input type="hidden" name="ids" class="ids" value="{$ids}">
  <!--左侧扇形导航-->
    {include file="common/left-nav" /}
  <!--左侧扇形导航--> 
</div>
{include file="common/script" /}

</body>
<script src="https://cdn.bootcss.com/jquery-weui/1.2.1/js/jquery-weui.min.js"></script>
</html>
<script>
  $('.weui-cell_swiped').swipeout()
  $('.addcustomer').click(function () {
    var url = "{$turl}"+'/web/customer/add'
    layer.open({
      type: 2, // 1-在content中写html代码， 2-在content中写src路径
      area: ['80%', '80%'],
      title: "添加客户",
      content: url,
      // content: Config.this_url+'/purchase/requisition',
    })
  })
  //下一步
    $('.next_step').click(function () {
        var c_id = $(':radio[name="checkbox1"]:checked').val();
        if(c_id == undefined || c_id == ''){
            layer.msg('请先选择客户')
            return false
        }
        layer.prompt({
            formType: 2,
            placeholder: '输入税点',
            title: '输入税点',
//                    area: ['800px', '350px'] //自定义文本域宽高
        }, function(value, index, elem){
            if(value != ''){
                var url = "{$turl}"+'/web/sales/confirm?c_id='+c_id+'&cart_ids='+$('.ids').val()+'&tax='+value
                window.location.href = url
            }
//                    alert(value); //得到value
            layer.close(index);
        });
        console.log(c_id)

    })
  //编辑
    $('body').on('click','.edit-swipeout',function () {
        var url = "{$turl}"+'/web/customer/edit?ids='+$(this).data('id')
        layer.open({
            type: 2, // 1-在content中写html代码， 2-在content中写src路径
            area: ['80%', '80%'],
            title: "添加客户",
            content: url,
            // content: Config.this_url+'/purchase/requisition',
        })
    })
</script>
<!---带扇形 不带footer->
